from .models import SystemNotification


# 上下文处理器
def notification_count(request):
    if request.user.is_authenticated:
        return {
            'unread_notifications_count': SystemNotification.objects.filter(
                user=request.user, is_read=False
            ).count()
        }
    return {}